package com.hup.mouseIcon;

import com.hup.mouseIcon.presenter.MainPresenterImpl;
import com.hup.utils.commons.start.AppInfo;
import com.hup.utils.commons.start.LookThemeUtil;
import com.hup.utils.commons.start.StartUpWindow;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author hugan
 * @date 2020/1/4
 */
@Log4j2
@AppInfo(chName = "光标指示器")
@ComponentScan(basePackages = {"com.hup.utils.commons.start", "com.hup.mouseIcon"})
@SpringBootApplication
public class MouseIcon {

    public static void main(String[] args) {
        LookThemeUtil.initNormal(null);

        StartUpWindow.startUp(() -> init(args));
    }

    private static void init(String[] args) {
        SpringApplicationBuilder builder = new SpringApplicationBuilder(MouseIcon.class);
        ApplicationContext context = builder.headless(false).run(args);

        MainPresenterImpl bean = context.getBean(MainPresenterImpl.class);
        bean.startUp();
    }

}
